#ifndef TRANSFER_H
#define TRANSFER_H

#include <functional>
#include <string>
#include <fcntl.h>
#include <sys/stat.h>
#include <mqueue.h>

class Transfer
  //POSIX消息队列实现方法
{
  public:
    Transfer(std::function<std::string(std::string)>);
    void run(); //启动消息处理循环
    void stop();
    virtual ~Transfer();
  private:
    std::function<std::string(std::string)> dataCallback;
    mqd_t queueFlag;
    bool runFlag=true;
    char* dataReceiveBuffer;
    long bufferSize;
};

#endif
